<img src="/estadisticas/save/2" width="1" height="1">
<div id="titulo_azul">
	<span>LISTA DE PROBLEMAS</span>
</div>
<div id="contenido_gral">
<script type="text/javascript">
<?php 
	$remoteFunction111 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'people_problems', 'action' => 'mostrarestado', $id_paciente,1,$archivados ),
		'update' => 'zona1', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction222 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'people_problems', 'action' => 'mostrarestado', $id_paciente,2,$archivados ),
		'update' => 'zona2', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction333 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'people_problems', 'action' => 'mostrarestado', $id_paciente,4,$archivados ),
		'update' => 'zona3', 'indicator' => 'cargando' 
	    ) 
	);

	$remoteFunction444 = $ajax->remoteFunction( 
	    array( 
		'url' => array( 'controller' => 'people_problems', 'action' => 'mostrarestado', $id_paciente,5,$archivados ),
		'update' => 'zona4', 'indicator' => 'cargando' 
	    ) 
	);

	echo $remoteFunction111.";";
	echo $remoteFunction222.";";
	echo $remoteFunction333.";";
	echo $remoteFunction444.";";
?>
</script>
<div id="problemas">
	<div id="zona2" class="droppable"><img src="/images/loading3.gif"/></div>
	<div id="zona4" class="droppable"><img src="/images/loading3.gif"/></div>
	<div id="zona3" class="droppable"><img src="/images/loading3.gif"/></div>
	<div id="zona1" class="droppable"><img src="/images/loading3.gif"/></div>
	<br/>
	<div id="ver_registros_archivados">
<?php 
	if(!$archivados){
				echo $ajax->link($html->image("/images/ico-archivados.gif", array('width' => '15','alt' => 'Mostrar los Registros Archivados','title' => 'Mostrar los Registros Archivados'))." Mostrar los Registros Archivados",'/people_problems/index/'.$id_paciente.'/archivados', array( 'update' => 'problemas_paciente', 'indicator' => 'cargando', 'escape'=> false)); 
	}else{
				echo $ajax->link($html->image("/images/ico-archivados.gif", array('width' => '15','alt' => 'Ocultar los Registros Archivados','title' => 'Ocultar los Registros Archivados'))." Ocultar los Registros Archivados",'/people_problems/index/'.$id_paciente, array( 'update' => 'problemas_paciente', 'indicator' => 'cargando', 'escape'=> false)); 
	}
?>
	</div>
	<!-- <a href="javascript:MostrarModal('ventana_modal','Asociar un Problema','/people_problems/add/<?php echo $id_paciente ?>','70%',450)" class="link_destacado">Asociar un Problema</a> -->
</div>
<script type="text/javascript">
//<![CDATA[
	Droppables.add('zona1',{
			hoverclass: 'hoverActive',
			onDrop:function(draggable, droppable, event) {
				draggable.parentNode.removeChild(draggable);
				droppable.appendChild(draggable);
/*
				var dimensions = droppable.getDimensions();
				alert(dimensions.height);
*/
				new Ajax.Request('/people_problems/cambiarestado', {asynchronous:true, parameters:{draggedid:draggable.id,zona:1}})
			}
	});

	Droppables.add('zona2',{
			hoverclass: 'hoverActive',
			onDrop:function(draggable, droppable, event) {
				draggable.parentNode.removeChild(draggable);
				droppable.appendChild(draggable);
				new Ajax.Request('/people_problems/cambiarestado', {asynchronous:true, parameters:{draggedid:draggable.id,zona:2}})
			}
	});
	Droppables.add('zona3',{
			hoverclass: 'hoverActive',
			onDrop:function(draggable, droppable, event) {
				draggable.parentNode.removeChild(draggable);
				droppable.appendChild(draggable);
				new Ajax.Request('/people_problems/cambiarestado', {asynchronous:true, parameters:{draggedid:draggable.id,zona:4}})
			}
	});
	Droppables.add('zona4',{
			hoverclass: 'hoverActive',
			onDrop:function(draggable, droppable, event) {
				draggable.parentNode.removeChild(draggable);
				droppable.appendChild(draggable);
				new Ajax.Request('/people_problems/cambiarestado', {asynchronous:true, parameters:{draggedid:draggable.id,zona:5}})
			}
	});
//]]>
</script>
</div>